package com.zjhome.cloudnote.mapper;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.zjhome.cloudnote.domain.UserInfo;

/**
 * 用户表 db 接口
 * 
 * @author 0283000121
 *
 */
@Repository
public interface UserMapper {
	/**
	 * 根据id 查询用户
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	UserInfo selectUserById(@Param("id") String id) throws Exception;
	
	
	/**
	 * 根据昵称查找用户信息
	 * 
	 * @param username	用户名
	 * @return
	 * @throws Exception
	 */
//	UserInfo selectUserByNickname(@Param("nickname") String nickname) throws Exception;
	
	/**
	 * 添加新用户
	 * 
	 * @param user	用户信息
	 * @return
	 * @throws Exception
	 */
	int	insertUserByParam(UserInfo userInfo) throws Exception;
	
	
	/**
	 * 更新用户信息
	 * 
	 * @param user	用户信息
	 * @return
	 * @throws Exception
	 */
	int updateUserByParam(UserInfo userInfo) throws Exception;
	
	/**
	 * 删除用户
	 * 
	 * @param id	用户id
	 * @return
	 * @throws Exception
	 */
	int deleteUserById(@Param("id") String id) throws Exception; 
}
